﻿using SeleniumExtension.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeleniumExtension.Services
{
    public class MockSqlServices
    {
        /// <summary>
        /// List of data objects
        /// </summary>
        /// <returns></returns>
        public List<DataObjects> GetSimpleDataObjects()
        {
            List<DataObjects> sqlData = new List<DataObjects>();
            sqlData.Add(new DataObjects() { Url = "http://www.google.com", Keywords = new string[] { "About Google" } });
            return sqlData;
        }

        public List<DataObjects> GetDynamicDataObjects()
        {
            List<DataObjects> sqlData = new List<DataObjects>();
            sqlData.Add(new DataObjects() { Url = "http://www.google.com", Keywords = null, DynamicCode = "using System; using System.Collections.Generic; using System.Linq; using System.Text; using OpenQA.Selenium; using SeleniumExtension.WebDriver; namespace SeleniumExtension.Services { public class MockDynaObject { public static void Run() { try { var baseUrl = \"http://www.google.com\"; InternetExplorer.Instance.Navigate().GoToUrl(baseUrl); Features.TakeScreenshot.Snap(InternetExplorer.Instance,Utilities.Utilities.GetFileName(baseUrl)); InternetExplorer.Instance.FindElement(By.Id(\"q\")).SendKeys(\"google\"); } catch (Exception ex) { throw ex; } finally { InternetExplorer.Instance.Close(); InternetExplorer.Instance.Quit(); } } }" });
            return sqlData;
        }
    }
}
